package com.ruoyi.orderEat.service.impl;

import com.ruoyi.orderEat.domain.ShopSpecification;
import com.ruoyi.orderEat.mapper.ShopSpecificationMapper;
import com.ruoyi.orderEat.service.ShopSpecificationService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class ShopSpecificationServiceImpl implements ShopSpecificationService{

    @Autowired
    private ShopSpecificationMapper shopSpecificationMapper;

    @Override
    public List<ShopSpecification> shopSpecificationList() {
        List<ShopSpecification> shopSpecificationList = shopSpecificationMapper.selectAll();
//        List<ShopSpecification> distinctShopSpecifications = shopSpecificationList
//                .stream()
//                .collect(Collectors.toMap(ShopSpecification::getSpecificationName, Function.identity(), (existing, replacement) -> existing))
//                .values()
//                .stream()
//                .collect(Collectors.toList());
        return shopSpecificationList;
    }

    @Override
    public int deleteByPrimaryKey(Long specificationId) {
        return shopSpecificationMapper.deleteByPrimaryKey(specificationId);
    }

    @Override
    public int insert(ShopSpecification record) {
        return shopSpecificationMapper.insert(record);
    }


    @Override
    public ShopSpecification selectByPrimaryKey(Long specificationId) {
        return shopSpecificationMapper.selectByPrimaryKey(specificationId);
    }

    @Override
    public int updateByPrimaryKeySelective(ShopSpecification record) {
        return shopSpecificationMapper.updateByPrimaryKeySelective(record);
    }


}
